package a10_动态规划;

import java.util.Scanner;

/**
 * <p>
 * a22_爬楼梯进阶版复习2
 * </p>
 *
 * @author flyduck
 * @since 2025/2/27
 */
public class a22_爬楼梯进阶版复习2 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int target = scanner.nextInt();
        int maxStep = scanner.nextInt();

        int[] dp = new int[target+1];
        dp[0] = 1;

        for (int j = 0; j <= target; j++) {
            for (int i = 1; i <= maxStep; i++) {
                if(j >= i){
                    dp[j] = dp[j] + dp[j - i];
                }
            }
        }

        System.out.println(dp[target]);
    }
}
